package com.example.demo.dao;


import java.util.List;

import com.example.demo.entity.RoleAndPermission;
import com.example.demo.mapper.RoleAndPermissionMapper;

/**
 * 
 * @author Henry.Y
 * @date 2019-05-27
 */
public class RoleAndPermissionDao extends BaseDao implements RoleAndPermissionMapper{

    public int insertRoleAndPermission(String sqlId,RoleAndPermission roleAndPermission){
    	
    	return operateInsertSql(sqlId,roleAndPermission);
    }
	
	public int insertRoleAndPermissionByList(String sqlId,List<RoleAndPermission> roleAndPermissionList){
		
		return operateInsertSql(sqlId,roleAndPermissionList);
	}

	public int deleteRoleAndPermission(String sqlId,RoleAndPermission roleAndPermission){
		
		return operateDeleteSql(sqlId,roleAndPermission);
	}
	
	public int deleteRoleAndPermissionByRoleList(String sqlId,List<String> roleList){
		
		return operateDeleteSql(sqlId,roleList);
	}
	
	public int deleteRoleAndPermissionByPermissionList(String sqlId,List<String> permissionList){
		
		return operateDeleteSql(sqlId,permissionList);
	}
	
	public int updateRoleAndPermission(String sqlId,RoleAndPermission roleAndPermission){
		
		return operateUpdateSql(sqlId,roleAndPermission);
	}
	
	public RoleAndPermission selectOneRoleAndPermission(String sqlId,RoleAndPermission roleAndPermission){
		
		return (RoleAndPermission)operateSelectOneSql(sqlId,roleAndPermission);
	}
	
	@SuppressWarnings("unchecked")
	public List<RoleAndPermission> selectRoleAndPermission(String sqlId){
		
		return (List<RoleAndPermission>)operateSelectSql(sqlId);
	}
	
	public int deleteRoleAndPermission(String sqlId){
		
		return deleteForFullTable(sqlId);
	}
	
	public int deleteRoleAndPermissionTable(String sqlId){
		
		return deleteForFullTable(sqlId);
	}
}
